<!-- application/views/script/login.phtml-->
<script src="/jquery-ui-1.8.custom/development-bundle/ui/jquery.ui.dialog.js"></script>
<script type="text/javascript">
	$(function() {		
		$( "#dialog-form" ).dialog({
			autoOpen: false,
			height: 150,
			width: 350,
			modal: true,			
			close: function() {
			$("#dialog-form input[type|='text'],#dialog-form input[type|='password']").val( "" ).removeClass( "ui-state-error" );
			}
		});
		
		$("a#login").click(function() {				
			$("#dialog-form").dialog( "open" );
			$("#dialog-form [name|='username']").focus();
			$("#dialog-form [name|='fromUrl']").val(location.href);		

		});
		$("#dialog-form [value|='login']").button().click(function(){$("#dialog-form form").submit();});
		$("#dialog-form [value|='cancel']").button().click(function(){$("#dialog-form").dialog( "close" );});

		var minHeight=$("div#container").height() - $("div#header").height() - $("div#footer").height();
		$("div#lside-bar").css("min-height", minHeight);
		$("div#content-frame").css("min-height", minHeight);
		
	
	});	
</script>
<div id="dialog-form" title="user login" style="display:none">
	<form  enctype="application/x-www-form-urlencoded" method="post" action="/auth/login" >
		<label>username:</label><input type="text" name="username" size=10/>
		<br><p/>
		<label>password:</label><input name="password" type="password" size=10/>
		<input name="fromUrl" type="hidden"/>
		<p/>
		<input type="button" value="login"/>&nbsp;&nbsp;
		<input type="button" value="cancel"/>
	</form>
</div>
